package org.example.concole;

import io.netty.channel.Channel;
import org.example.CreateGroupRequestPacket;

import java.util.Arrays;
import java.util.Scanner;

public class CreateGroupConsoleCommand implements ConsoleCommand {
    @Override
    public void exec(Scanner scanner, Channel channel) {
        // 创建群组
        CreateGroupRequestPacket createGroupRequestPacket = new CreateGroupRequestPacket();
        System.out.println("创建群聊，请输入userId列表,英文逗号分隔符隔:");
        String userIds = scanner.next();
        createGroupRequestPacket.setUserIds(Arrays.asList(userIds.split(",")));
        channel.writeAndFlush(createGroupRequestPacket);
    }
}
